package com.thomasmoerman.dci3.domain

import com.thomasmoerman.dci3.frw.{Entity => SEntity}
import javax.persistence._

@Entity
class MoneyTransfer extends SEntity {
  
  def this(a: Account, m: Double) {
	this()
	
	account = a
	amount = m
  }
	
  @ManyToOne var account: Account = _
  
  @Basic var amount: Double = 0
  
}
  
object Increase {
  
  def apply(account: Account, amount: Double) = new MoneyTransfer(account, amount)
  
}

object Decrease {

  def apply(account: Account, amount: Double) = new MoneyTransfer(account, -amount)
  	
}